package co.baiku.boot.live.baijiayun.request;

import co.baiku.boot.live.baijiayun.type.BaiJiaRoomTemplateType;

import java.util.HashMap;
import java.util.Map;

/**
 * 百家云更新直播间接口参数
 *
 * @author haojiaolong
 * @date 2020/11/8 23:31
 */
public class BaiJiaRoomUpdateRequest extends BaiJiaLiveRequest {

    /**
     * 直播间id
     */
    private Long roomId;
    /**
     * 直播课标题，不超过50个字符或汉字，超过部分将进行截取
     */
    private String title;
    /**
     * 开课时间, unix时间戳（秒）
     */
    private Long startTime;
    /**
     * 下课时间, unix时间戳（秒）
     */
    private Long endTime;
    /**
     * 代表普通大班课最大人数, 不传或传0表示不限制。
     */
    private Integer maxUsers;
    /**
     * 学生可提前进入的时间，单位为秒
     */
    private Long preEnterTime;
    /**
     * 企业直播可选值：singleVideo（单视频），docAudio（文档加音频），docVideo（文档加视频）
     */
    private BaiJiaRoomTemplateType templateName;
    /**
     * 是否是推流直播，0:常规直播 1:推流直播 默认是常规直播（注：需要给账号开通推流直播的权限）
     */
    private Integer isPushLive;

    public BaiJiaRoomUpdateRequest() {
    }

    public BaiJiaRoomUpdateRequest(String roomId, String title, Long startTime, Long endTime) {
        this.title = title;
        this.startTime = startTime;
        this.endTime = endTime;
        this.templateName = BaiJiaRoomTemplateType.singleVideo;
        this.roomId = Long.valueOf(roomId);
    }

    @Override
    protected Map<String, Object> buildMap() {
        Map<String, Object> data = new HashMap<>(16);
        data.put("title", title);
        data.put("start_time", startTime);
        data.put("end_time", endTime);
        data.put("max_users", maxUsers);
        data.put("pre_enter_time", preEnterTime);
        data.put("template_name", templateName);
        data.put("is_push_live", isPushLive);
        data.put("room_id", roomId);
        return data;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public Long getEndTime() {
        return endTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }

    public Integer getMaxUsers() {
        return maxUsers;
    }

    public void setMaxUsers(Integer maxUsers) {
        this.maxUsers = maxUsers;
    }

    public Long getPreEnterTime() {
        return preEnterTime;
    }

    public void setPreEnterTime(Long preEnterTime) {
        this.preEnterTime = preEnterTime;
    }

    public BaiJiaRoomTemplateType getTemplateName() {
        return templateName;
    }

    public void setTemplateName(BaiJiaRoomTemplateType templateName) {
        this.templateName = templateName;
    }

    public Integer getIsPushLive() {
        return isPushLive;
    }

    public void setIsPushLive(Integer isPushLive) {
        this.isPushLive = isPushLive;
    }
}
